package com.example.shop_2211.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.GoodsBean
import com.example.shop_2211.R
import com.example.shop_2211.utils.GlideUtils

class GoodsAdapter:BaseQuickAdapter<GoodsBean,BaseViewHolder>(R.layout.item_goods) {
    override fun convert(holder: BaseViewHolder, item: GoodsBean) {
        GlideUtils.loadImage(context,item.image,holder.getView(R.id.goods_image))
        holder.setText(R.id.goods_name,item.storeName)
        holder.setText(R.id.goods_price,"价格：￥${item.price}")
        holder.setText(R.id.goods_sales,"销量：${item.sales+item.ficti}")
    }
}